home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Applications / Text / Text Editors / stevie 3.10 / stevie.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-03  |  4.4 KB  |  258 lines  |  [TEXT/STvi]

  1. /*
  2.  * $Header: /nw/tony/src/stevie/src/RCS/stevie.h,v 1.19 89/07/12 21:33:32 tony Exp $
  3.  *
  4.  * Main header file included by all source files.
  5.  */
  6.  
  7. #ifndef STEVIE
  8. #define STEVIE
  9. #include "env.h"    /* defines to establish the compile-time environment */
  10.  
  11. #include <stdio.h>
  12. #include <ctype.h>
  13.  
  14. #ifdef    BSD
  15.  
  16. #include <strings.h>
  17. #define strchr index
  18.  
  19. #else
  20.  
  21. #ifdef    MINIX
  22.  
  23. extern    char    *strchr();
  24. extern    char    *strrchr();
  25. extern    char    *strcpy();
  26. extern    char    *strcat();
  27. extern    int    strlen();
  28.  
  29. #else
  30. #include <string.h>
  31. #endif
  32.  
  33. #endif
  34.  
  35. #include "ascii.h"
  36. #include "keymap.h"
  37. #include "param.h"
  38. #include "term.h"
  39.  
  40. extern    char    *strchr();
  41.  
  42. #define NORMAL 0
  43. #define CMDLINE 1
  44. #define INSERT 2
  45. #define REPLACE 3
  46. #define FORWARD 4
  47. #define BACKWARD 5
  48.  
  49. /*
  50.  * Boolean type definition and constants
  51.  */
  52. typedef    short    bool_t;
  53.  
  54. #ifndef    TRUE
  55. #define    FALSE    (0)
  56. #define    TRUE    (1)
  57. #endif
  58.  
  59. /*
  60.  * SLOP is the amount of extra space we get for text on a line during
  61.  * editing operations that need more space. This keeps us from calling
  62.  * malloc every time we get a character during insert mode. No extra
  63.  * space is allocated when the file is initially read.
  64.  */
  65. #define    SLOP    10
  66.  
  67. /*
  68.  * LINEINC is the gap we leave between the artificial line numbers. This
  69.  * helps to avoid renumbering all the lines every time a new line is
  70.  * inserted.
  71.  */
  72. #define    LINEINC    10
  73.  
  74. #define CHANGED        Changed=TRUE
  75. #define UNCHANGED    Changed=FALSE
  76.  
  77. struct    line {
  78.     struct    line    *prev, *next;    /* previous and next lines */
  79.     char    *s;            /* text for this line */
  80.     int    size;            /* actual size of space at 's' */
  81.     unsigned long    num;        /* line "number" */
  82. };
  83.  
  84. #define    LINEOF(x)    ((x)->linep->num)
  85.  
  86. struct    lptr {
  87.     struct    line    *linep;        /* line we're referencing */
  88.     int    index;            /* position within that line */
  89. };
  90.  
  91. typedef    struct line    LINE;
  92. typedef    struct lptr    LPTR;
  93.  
  94. struct charinfo {
  95.     char ch_size;
  96.     char *ch_str;
  97. };
  98.  
  99. extern struct charinfo chars[];
  100.  
  101. extern    int    State;
  102. extern    int    Rows;
  103. extern    int    Columns;
  104. extern    char    *Realscreen;
  105. extern    char    *Nextscreen;
  106. extern    char    *Filename;
  107. extern    LPTR    *Filemem;
  108. extern    LPTR    *Filetop;
  109. extern    LPTR    *Fileend;
  110. extern    LPTR    *Topchar;
  111. extern    LPTR    *Botchar;
  112. extern    LPTR    *Curschar;
  113. extern    LPTR    *Insstart;
  114. extern    int    Cursrow, Curscol, Cursvcol, Curswant;
  115. extern    bool_t    set_want_col;
  116. extern    int    Prenum;
  117. extern    bool_t    Changed;
  118. extern    char    Redobuff[], Insbuff[];
  119. extern    char    *Insptr;
  120. extern    int    Ninsert;
  121. extern    bool_t    got_int;
  122.  
  123. extern    char    *malloc(), *strcpy();
  124.  
  125. /*
  126.  * alloc.c
  127.  */
  128. char    *alloc(), *strsave(), *mkstr();
  129. void    screenalloc(), filealloc(), freeall();
  130. LINE    *newline();
  131. bool_t    bufempty(), buf1line(), lineempty(), endofline(), canincrease();
  132.  
  133. /*
  134.  * cmdline.c
  135.  */
  136. void    docmdln(), dotag(), msg(), emsg(), smsg(), gotocmd(), wait_return();
  137. char    *getcmdln();
  138.  
  139. /*
  140.  * edit.c
  141.  */
  142. void    edit(), insertchar(), getout(), scrollup(), scrolldown(), beginline();
  143. bool_t    oneright(), oneleft(), oneup(), onedown();
  144.  
  145. /*
  146.  * fileio.c
  147.  */
  148. void    filemess(), renum();
  149. bool_t    readfile(), writeit();
  150. FILE *fopenb();
  151. FILE *fopen();
  152.  
  153. #ifdef MACINTOSH
  154. #define fopen(a,b) fopenb(a,b)
  155. #define fprintf myfprintf
  156. #define printf myprintf
  157. #define exit windexit
  158. #endif
  159.  
  160. /*
  161.  * help.c
  162.  */
  163. bool_t    help();
  164.  
  165. /*
  166.  * linefunc.c
  167.  */
  168. LPTR    *nextline(), *prevline(), *coladvance();
  169.  
  170. /*
  171.  * main.c
  172.  */
  173. void    stuffin(), stuffnum();
  174. void    do_mlines();
  175. int    vgetc();
  176. bool_t    anyinput();
  177.  
  178. /*
  179.  * mark.c
  180.  */
  181. void    setpcmark(), clrall(), clrmark();
  182. bool_t    setmark();
  183. LPTR    *getmark();
  184.  
  185. /*
  186.  * misccmds.c
  187.  */
  188. void    opencmd(), fileinfo(), inschar(), delline();
  189. bool_t    delchar();
  190. int    cntllines(), plines();
  191. LPTR    *gotoline();
  192.  
  193. /*
  194.  * normal.c
  195.  */
  196. void    normal();
  197.  
  198. /*
  199.  * param.c
  200.  */
  201. void    doset();
  202.  
  203. /*
  204.  * ptrfunc.c
  205.  */
  206. int    inc(), dec();
  207. int    gchar();
  208. void    pchar(), pswap();
  209. bool_t    lt(), equal(), ltoreq();
  210. #if 0
  211. /* not currently used */
  212. bool_t    gtoreq(), gt();
  213. #endif
  214.  
  215. /*
  216.  * screen.c
  217.  */
  218. void    updatescreen(), updateline();
  219. void    screenclear(), cursupdate();
  220. void    s_ins(), s_del();
  221. void    prt_line();
  222.  
  223. /*
  224.  * search.c
  225.  */
  226. void    dosub(), doglob();
  227. bool_t    searchc(), crepsearch(), findfunc(), dosearch(), repsearch();
  228. LPTR    *showmatch();
  229. LPTR    *fwd_word(), *bck_word(), *end_word();
  230.  
  231. /*
  232.  * undo.c
  233.  */
  234. void    u_save(), u_saveline(), u_clear();
  235. void    u_lcheck(), u_lundo();
  236. void    u_undo();
  237.  
  238. /*
  239.  * Machine-dependent routines.
  240.  */
  241. int    inchar();
  242. void    flushbuf();
  243. void    outchar(), outstr(), beep();
  244. #ifndef MACINTOSH
  245. char    *fixname();
  246. #else
  247. #define fixname(x) (x)
  248. #endif
  249. #ifndef    OS2
  250. #ifndef    DOS
  251. void    remove(), rename();
  252. #endif
  253. #endif
  254. void    windinit(), windexit(), windgoto();
  255. void    delay();
  256. void    doshell();
  257. #endif
  258.